﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UpdatePasswordUserControl.ascx.cs"
    Inherits="JM.JCY.SharePointComponent.UserManagement.UpdatePassword.UpdatePasswordUserControl" %>

<script type="text/javascript">

    $(document).ready(function () {
        $("#tdChangePasswordToggle1").click(function () {
            var div = document.getElementById("divToggleChangePassword");
            if (div.style.display == "") {
                div.style.display = "none";
                $("#imgToggleChangePassword").attr("src", "/_layouts/JM.JCY.Resource/images/toggle_expand.png");

            }
            else {
                div.style.display = "";
                $("#imgToggleChangePassword").attr("src", "/_layouts/JM.JCY.Resource/images/toggle_collapse.png");
            }
        });

        $("#tdChangePasswordToggle2").click(function () {
            var div = document.getElementById("divToggleChangePassword");
            if (div.style.display == "") {
                div.style.display = "none";
                $("#imgToggleChangePassword").attr("src", "/_layouts/JM.JCY.Resource/images/toggle_expand.png");

            }
            else {
                div.style.display = "";
                $("#imgToggleChangePassword").attr("src", "/_layouts/JM.JCY.Resource/images/toggle_collapse.png");
            }
        });
    });
   

</script>

<div runat="server" id="DivDeptDoc">
    <table class="main" width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td>
                <table class="webpart" width="450" cellpadding="0" cellspacing="0">
                    <tr>
                             <th align="left" id="tdChangePasswordToggle1" class="title" width="50%" style="cursor: pointer">
                            <img src="/_layouts/JM.JCY.Resource/images/key.png" width="24" />
                             修改登陆密码
                        </th>
                          <th id="tdChangePasswordToggle2"class="link" align="right" width="50%" style="cursor: pointer">
                          
                            <img class="toggle" id="imgToggleChangePassword" src="/_layouts/JM.JCY.Resource/images/toggle_collapse.png" />
                        </th>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <br />
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <div id="divToggleChangePassword">
                                <table width="100%">
                                    <tr>
                                        <td valign="top" runat="server" id="tdContent">
                                            <table width="98%">
                                                <tr>
                                                    <td>
                                                        <table width="100%" class="form">
                                                            <tr>
                                                                <td>
                                                                    <b>请输入老密码</b>
                                                                </td>
                                                                <td>
                                                                    ：
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtCurrentPW" runat="server" TextMode="Password" ></asp:TextBox>
                                                                    <asp:RequiredFieldValidator Style="display: block" ID="rfvNewPW0" runat="server"
                                                                        ErrorMessage="请输入老密码." Display="Dynamic" ControlToValidate="txtCurrentPW" ValidationGroup="ChangePW"></asp:RequiredFieldValidator>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td width="35%">
                                                                    <b>请输入新密码</b>
                                                                </td>
                                                                <td width="1%">
                                                                    :
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtNewPW" Style="display: block;" TextMode="Password" MaxLength="10"
                                                                        runat="server"></asp:TextBox>
                                                                               <asp:RequiredFieldValidator Style="display: block" ID="rfvNewPW" runat="server" ErrorMessage="请输入新密码."
                                                                        Display="Dynamic" ControlToValidate="txtNewPW" ValidationGroup="ChangePW">
                                                                    </asp:RequiredFieldValidator>
                                                                    <asp:RegularExpressionValidator ID="reExval" runat="server" 
                                            ErrorMessage="密码长度不能少于3位，并且不能大于10位" ControlToValidate="txtNewPW" 
                                            ValidationExpression="^.{3,20}" ValidationGroup="ChangePW" Display="Dynamic"></asp:RegularExpressionValidator>
                                                             
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td width="35%">
                                                                    <b>请再次输入新密码</b>
                                                                </td>
                                                                <td width="1%">
                                                                    :
                                                                </td>
                                                                <td width="73%">
                                                                    <asp:TextBox ID="txtNewPWConfirm" Style="display: block;" TextMode="Password" MaxLength="10"
                                                                        runat="server"></asp:TextBox>
                                                                             <asp:RequiredFieldValidator Style="display: block" ID="rfvPWConfirm" runat="server"
                                                                        ErrorMessage="请再次输入新密码." Display="Dynamic" ControlToValidate="txtNewPWConfirm"
                                                                        ValidationGroup="ChangePW"></asp:RequiredFieldValidator>
                                                                    <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="CompareValidator" Display="Dynamic"
                                                                        ControlToCompare="txtNewPW" ControlToValidate="txtNewPWConfirm" ValidationGroup="ChangePW">2次的密码输入不一直</asp:CompareValidator>
                                                               
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                                <tr><td><asp:Label ID="lbMessage" runat="server"></asp:Label></td></tr>
                                                <tr>
                                                    <td align="right">
                                                        <asp:ImageButton ID="imgSave" runat="server" ImageUrl="~/_layouts/JM.JCY.Resource/images/save.png"
                                                            OnClick="imgSave_Click" ValidationGroup="ChangePW" />
                                                                  <asp:ImageButton ID="imgCancel" runat="server" 
                                                            ImageUrl="~/_layouts/JM.JCY.Resource/images/cancel.png" onclick="imgCancel_Click"
                                                         />
                                                     
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>